package com.rcloud.server.sealtalk.controller;

import com.rcloud.server.sealtalk.domain.SysConfig;
import com.rcloud.server.sealtalk.domain.VerificationCodes;
import com.rcloud.server.sealtalk.exception.ServiceException;
import com.rcloud.server.sealtalk.model.response.APIResult;
import com.rcloud.server.sealtalk.model.response.APIResultWrap;
import com.rcloud.server.sealtalk.service.SysConfigService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Example;

/**
 * 参数配置 信息操作处理
 *
 * @author ruoyi
 */
@RestController
@RequestMapping("/system/config")
public class SysConfigController extends BaseController {
    @Autowired
    private SysConfigService configService;

    @ApiOperation(value = "获取认证费用的配置 固定配置 AUTH_COST_CONFIG")
    @RequestMapping(value = "/{configKey}", method = RequestMethod.POST)
    public APIResult<Object> queryAuthCostConfig(@PathVariable String configKey) {
        //获取配置信息
        Example example = new Example(SysConfig.class);
        example.createCriteria().andEqualTo("configKey", configKey);
        SysConfig config = configService.getOneByExample(example);
        return APIResultWrap.ok(config);
    }




}
